package com.mc.cloud.mall.common.exception;

/**
 * @ClassName MallException
 * @Author MC
 * @Date 2021/5/20 12:51
 * @Version 1.0
 **/
public class MallException extends RuntimeException {
    
    private final Integer code;
    private final String message;
    
    public MallException(Integer code,String message){
        this.code = code;
        this.message = message;
    }
    
    public MallException(MallExceptionEnum exceptionEnum){
        this(exceptionEnum.getCode(),exceptionEnum.getMsg());
    }
    
    public Integer getCode() {
        return code;
    }
    
    @Override
    public String getMessage() {
        return message;
    }
}
